package com.lcy.service;

import com.lcy.dao.Smbms_UserDao;
import com.lcy.entry.SmbmsUser;

public class LoginService {

    public boolean login(String userName, String userPasswordParam) {
        try {
            Smbms_UserDao smbmsUserDao = new Smbms_UserDao();
            SmbmsUser smbmsUser = smbmsUserDao.getSmbmsUserByUserCode( userName);
            if (smbmsUser != null) {
                if (smbmsUser.getUserPassword().equals(userPasswordParam)) {
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
}

